<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.listAuth{line-height:22px;}
.listAuth input{border:0;}
.listAuth hr{height:1px; color:#ccc;}
th{text-align:right;}
td{text-align:left;}
-->
</style>
</head>
<body>
<div class="wrapper">
  <div class="title shadow titleBg">
    <table width="100%" border="0" cellspacing="1">
      <tr>
        <td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}
    添加{:/if} </h1></td>
      </tr>
    </table>
  </div>
  <div class="content shadow">
  <form>
  <table width="100%" border="0" cellspacing="1">
  <tr>
    <th>组别名称：</th>
    <td><input name="name" type="text" size="20" maxlength="20" value="{:$i->group->name}" class="posted" /></td>
  </tr>
  <tr>
    <th>拥有权限：<br /></th>
    <td class="listAuth">
    {:foreach item=item from=$i->auth}
        <input id="label{:$item->id}" name="auth[]" type="checkbox" value="{:$item->auth}" {:$item->checked} class="{:if $item->auth == '**'}all{:else}other{:/if} posted" />
        <label for="label{:$item->id}">
        	{:$item->name}
        </label>
        {:if $item->line == 1}<hr />{:/if}
    {:/foreach} 
    </td>
  </tr>
  <tr>
    <th>&nbsp;</th>
    <td><input type="submit" value=" 提 交 " />&nbsp;<input type="reset" onclick="history.go(-1);" value=" 返 回 " />    </td>
  </tr>
</table>
</form>

  </div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(".all").click(
	function () {
		if(this.checked){
			$("input[class='other posted']").each(function(i){
				this.checked=false;
			});
		}
	}
);

$(".other").click(
	function () {
		if(this.checked){
			$("input[class='all posted']").each(function(i){
				this.checked=false;
			});
		}
	}
);

$(document).ready(function(){
	$("form").post({
		sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
		goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
	});
});
</script>
</body>
</html>
